package com.dxf.sysadmin.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dxf.common.utils.ResultJson;
import com.dxf.sysadmin.entity.Clazz;
import com.dxf.sysadmin.entity.EvaluteType;
import com.dxf.sysadmin.entity.qo.MyPage;
import com.dxf.sysadmin.service.EvaluteTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/admin/evaluteType")
@Api(tags  = "EvaluteTypeController|评价类型控制器")
public class EvaluteTypeController {
    @Autowired
    private EvaluteTypeService evaluteTypeService;

    /**
     * @Description: 评价类型列表分页查询
     */
    @PostMapping("typePage")
    @ApiOperation("评价类型列表分页查询")
    public ResultJson typePage(@RequestBody MyPage qry){
        return evaluteTypeService.typePage(qry);
    }

    /**
     * @Description: 更具id列表删除评价类型
     */
    @PostMapping("delete")
    @ApiOperation(value = "更具id列表删除评价类型")
    public ResultJson deleteType(@RequestParam("list[]") List<Long>  list){
        return evaluteTypeService.deleteType(list);
    }

    /**
     * @Description: 新增或者更新评价类型
     */
    @PostMapping("saveOrUpdate")
    @ApiOperation(value="新增或者更新评价类型")
    public ResultJson saveOrUpdateType( @RequestBody EvaluteType type) {
        return evaluteTypeService.saveOrUpdateType(type);
    }
}
